Fix SCF user profile field table layout on profile/edit screens#387
Fix SCF user profile field table layout on profile/edit screens#387meravi wants to merge 4 commits into
Conversation
Scope layout CSS to profile/user-edit screens using wp_add_inline_style. Limit width rules to text-like inputs, textarea, and select2 to avoid side effects. Add PHPUnit coverage for generated user form layout CSS. Fixes WordPress#349
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
cbravobernal
left a comment
There was a problem hiding this comment.
Verified locally: the new Test_Form_User tests pass, PHPStan is green, and a phpcs comparison against trunk shows no new sniff findings (the existing violations in form-user.php are pre-existing legacy issues).
This approach supersedes #362 nicely: wp_add_inline_style( 'acf-input', ... ) instead of echoing in admin_head, and acf_is_screen() coverage including the network admin screens.
One request: the changes to tests/e2e/field-helpers.js and tests/e2e/field-type-image.spec.ts (timeout bumps) look unrelated to the user-profile layout fix. Could you either drop them from this PR or move them to a separate one? Keeping the diff scoped makes this easier to land.
Verification run via Claude Code, reviewed by @cbravobernal.
What this PR does
This fixes the layout issue from #349 on user profile/edit screens where SCF fields can look misaligned inside the WordPress
form-table.I moved the styling fix into the normal enqueue flow using
wp_add_inline_style()and limited it to user profile/edit admin screens only.Changes
ACF_Form_User::admin_enqueue_scripts()profileuser-editprofile-networkuser-edit-networkWhy
My previous attempt fixed the UI issue, but this version keeps the implementation cleaner and closer to WordPress coding standards, with narrower scope to avoid side effects.
Related
Fixes #349
Fixes https://github.com/WordPress/secure-custom-fields/issues/349